package com.huluobo.a2109monthdemo.category

import androidx.lifecycle.MutableLiveData
import com.huluobo.a2109monthdemo.base.BaseViewModel

/**
 *  Created by LC on 2024/1/26.
 */
class CategoryViewModel : BaseViewModel() {
    private val repo = CategoryRepo()
    val categorySuccess = MutableLiveData<CategoryBeanResult>()
    val categoryFailed = MutableLiveData<String>()

    val categoryGoodsListSuccess = MutableLiveData<CategoryGoodsListBeanResult>()
    val categoryGoodsListFailed = MutableLiveData<String>()

    fun getCategory() {
        repo.getCategory(categorySuccess, categoryFailed)
    }

    fun getCategoryGoodsList(categoryId: Int, currentPage: Int, pageSize: Int) {
        repo.getCategoryGoodsList(categoryId, currentPage, pageSize, categoryGoodsListSuccess, categoryGoodsListFailed)
    }
}